

package cn.itcast.dao;

import cn.itcast.domain.Orders;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author :HCH
 * @version : 1.0.0
 * @date :Created in 2019/7/10 17:59
 * @description :TODO
 * @modified :
 */

public interface OrdersDao {

    /*
    *
    * <td>${orders.id }</td>
											<td>${orders.orderNum }</td>
											<td>${orders.product.productName }</td>
											<td>${orders.product.productPrice }</td>
											<td>${orders.orderTimeStr }</td>
    * */


    @Select("select o.id,o.ordernum,p.productname,p.productprice,o.ordertime,o.orderstatus from orders o,product p where o.productid = p.id")

    @Results({
         @Result(column = "productname",property = "product.productName"),
         @Result(column = "productprice",property = "product.productPrice")

    })
    List<Orders> findAll();


}
